rm -rf /usr/local/postgresql/data
rm -rf /usr/local/postgresql/log
mkdir /usr/local/postgresql/data
mkdir /usr/local/postgresql/log
chown -R postgres:postgres /usr/local/postgresql/data
chown -R postgres:postgres /usr/local/postgresql/log
su postgres
/usr/local/postgresql/bin/initdb -D /usr/local/postgresql/data
/usr/local/postgresql/bin/pg_ctl -D /usr/local/postgresql/data -l /usr/local/postgresql/log/pg.log start
/usr/local/postgresql/bin/psql -p 5432
/usr/local/postgresql/bin/pg_ctl stop -D /usr/local/postgresql/data
cd /usr/local/postgresql/log
code ./pg.log